import { createRouter, createWebHashHistory } from 'vue-router'

const router = createRouter({
  history: createWebHashHistory(),
  routes: [
    {
      path: '/',
      name: 'index',
      redirect: { name: 'home' }
    },
    {
      path: '/home',
      name: 'home',
      component: () => import('@renderer/views/Home.vue'),
      redirect: '/todo',
      children: [
        {
          path: '/todo',
          component: () => import('@renderer/views/Todo.vue'),
          redirect: '/today',
          children: [
            {
              path: '/today',
              name: 'today',
              component: () => import('@renderer/views/TodoToday.vue')
            },
            {
              path: '/week',
              name: 'week',
              component: () => import('@renderer/views/TodoWeek.vue')
            },
            {
              path: '/collect',
              name: 'collect',
              component: () => import('@renderer/views/TodoCollect.vue')
            },
            {
              path: '/done',
              name: 'done',
              component: () => import('@renderer/views/TodoDone.vue')
            },
            {
              path: '/trash',
              name: 'trash',
              component: () => import('@renderer/views/TodoTrash.vue')
            },
            {
              path: '/list',
              name: 'list',
              component: () => import('@renderer/views/TodoList.vue')
            }
          ]
        },
        {
          path: '/habit',
          name: 'habit',
          component: () => import('@renderer/views/Habit.vue')
        }
      ]
    },
    {
      path: '/addTodoNav',
      name: 'addTodoNav',
      component: () => import('@renderer/windows/AddTodoNav.vue')
    },
    {
      path: '/setting',
      name: 'setting',
      component: () => import('@renderer/windows/Setting.vue'),
      redirect: '/setting/theme',
      children: [
        {
          path: '/setting/theme',
          name: 'setting-theme',
          component: () => import('@renderer/components/setting/Theme.vue')
        },
        {
          path: '/setting/about',
          name: 'setting-about',
          component: () => import('@renderer/components/setting/About.vue')
        }
      ]
    }
  ]
})

export default router
